//
//  BZYHomeNavView.m
//  BZYMeituan
//
//  Created by 毕仲阳 on 16/9/15.
//  Copyright © 2016年 mycompany. All rights reserved.
//

#import "BZYHomeNavView.h"

@interface BZYHomeNavView ()
@property (weak, nonatomic) IBOutlet UIButton *coverButton;
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UILabel *subtitleLabel;

@end
@implementation BZYHomeNavView

+ (instancetype)homeNavView
{
    return [[NSBundle mainBundle]loadNibNamed:@"BZYHomeNavView" owner:nil options:nil].firstObject;
}
- (IBAction)buttonClick:(id)sender {
    [self sendActionsForControlEvents:UIControlEventTouchUpInside];
}

- (void)setTarget:(id)target action:(SEL)action
{
    [self.coverButton addTarget:target action:action forControlEvents:UIControlEventTouchUpInside];
}

- (void)setTitle:(NSString *)title
{
    self.titleLabel.text = title;
}
- (void)setSubtitle:(NSString *)subtitle
{
    self.subtitleLabel.text = subtitle;
}
- (void)setIcon:(NSString *)icon highlightIcon:(NSString *)highlightIcon
{
    [self.coverButton setImage:[UIImage imageNamed:icon] forState:UIControlStateNormal];
    [self.coverButton setImage:[UIImage imageNamed:highlightIcon] forState:UIControlStateHighlighted];
}
- (void)awakeFromNib
{
    [super awakeFromNib];
    
    self.autoresizingMask = UIViewAutoresizingNone;
}

@end
